package io;

import java.io.*;

public class File5 {

    public static void main(String[] args) throws IOException {

        File file = new File("./testDir/a.txt");
        System.out.println(file.exists());

        //打开文件
        InputStream inputStream = new FileInputStream("./testDir/a.txt");
        while (true) {
            int b = inputStream.read();
            if (b == -1) {
                break;
            }
            System.out.print(b + " ");
        }
        //关闭文件, 防止资源泄露
        inputStream.close();
    }

}
